Remember that money usually has a decimal part , so we ll use a double data type internally for it , although a real bank would not do this because of rounding errors when converting from decimal to binary and back 記住款項(xiàng)通常具有小數(shù)部分,因此我們將在內(nèi)部對(duì)它使用double數(shù)據(jù)類型,雖然真實(shí)的銀行不會(huì)這樣做,因?yàn)樵趯?duì)小數(shù)和二進(jìn)制進(jìn)行來回轉(zhuǎn)換時(shí)會(huì)產(chǎn)生舍入錯(cuò)誤。